package service.serviceImpl;

import dao.PermissionMapper;
import dao.daoImpl.PermissionMapperImpl;
import pojo.Function;
import pojo.SecoundMenu;
import service.PermissionService;

import java.sql.SQLException;
import java.util.List;

/**
 * Created by Administrator on 2017-12-10.
 */
public class PermissionServiceImpl implements PermissionService {
    PermissionMapper permissionMapper=new PermissionMapperImpl();

    @Override
    public int addFunction(Function function) throws SQLException {
        return permissionMapper.addFunction(function);
    }
    @Override
    public List<Function> manageModule() throws SQLException {
        return permissionMapper.manageModule();
    }

    @Override
    public List<Function> getCurrFunction(int pageNow, int page_size) throws SQLException {
        return permissionMapper.getCurrFunction(pageNow,page_size);
    }

    @Override
    public int openFunction(int id,String functionDoc) throws SQLException {
        return permissionMapper.openFunction(id,functionDoc);
    }

    @Override
    public int delFunction(int id) throws SQLException {
        return permissionMapper.delFunction(id);
    }

    @Override
    public List<SecoundMenu> getSecoundMenu() throws SQLException {
        return permissionMapper.getSecoundMenu();
    }

    @Override
    public Function checkFunction(String moduleName, String secoundMenu) throws SQLException {
        return permissionMapper.checkFunction(moduleName,secoundMenu);
    }

    @Override
    public SecoundMenu getFid(String secoundMenu) throws SQLException {
        return permissionMapper.getFid(secoundMenu);
    }

    @Override
    public int addSecoundMenu(SecoundMenu secoundMenu) throws SQLException {
        return permissionMapper.addSecoundMenu(secoundMenu);
    }
}
